package export

import (
	"api_online/config"
	"api_online/core/export/eol"
	"api_online/core/export/rap"
	"fmt"
	"net/http"
)

func Rap(w http.ResponseWriter, r *http.Request) {
	json := rap.Rap()
	w.Write(json)
}

func Eol(w http.ResponseWriter, r *http.Request) {
	domain := config.Config.EolDomain
	xmlStr := eol.Eol(domain)

	xmlHeader := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
	xmlStr = fmt.Sprintf("%s\n%s", xmlHeader, xmlStr)
	xmlByte := []byte(xmlStr)
	w.Write(xmlByte)
}